import http from './http.js'

//获取openid
export const wechatLogin = (data) => http('/api/code', data, 'POST');


//个人用户注册
export const wechatRegist = (data) => http('/api/regist', data, 'POST');


//工作人员和管理员注册登录
export const wechatAdminLogin = (data) => http('/api/adminLogin', data, 'POST');

//新增事件
export const addEvent = (data) => http('/api/event/addEvent', data, 'POST');

//查看列表
export const getEventList = (userId) => http('/api/event/getWechatEventList', {userId});

//查看事件详情
export const getEventInfo = (id) => http('/api/event/getEventById', {id});
//发送短信验证码
export const sendCode = (tel) => http('/api/event/sendCode', {tel});

//绑定手机号
export const wechatTel = (data) => http('/api/event/wechatTel', data, 'POST');

//修改昵称和头像
export const updateInfo = (data) => http('/api/event/updateInfo', data, 'POST');

//查看村居列表
export const queryAreaByPage = (pageNum,pageSize) => http('/api/area/queryAreaByPage', {pageNum,pageSize});

//查看事件类别
export const queryEventTypeByPage = (pageNum,pageSize) => http('/api/event_type/queryEventTypeByPage', {pageNum,pageSize});

//查看事件等级
export const queryEventLevelByPage = (pageNum,pageSize) => http('/api/event_level/queryEventLevelByPage', {pageNum,pageSize});

//获取所有的部门信息
export const queryDepartmentByPage = (pageNum,pageSize) => http('/api/department/queryDepartmentByPage', {pageNum,pageSize});



//图片上传相关的解耦
export const uploadToken = () => http('/api/upload/token', {});


//工作人员端的接口
export const getWorkCount = (userId) => http('/api/work/getCount', {userId});

export const getWorkList = (userId) => http('/api/work/getWorkEventList', {userId});

export const updateEvent = (data) => http('/api/work/updateEvent', data, 'POST');


//预约接口  
export const appointment = (data) => http('/api/appointment/addAppointment', data, 'POST');

export const getappointmentlist = (userId, pageSize, pageNum) => http('/api/appointment/queryAppointmentByPage', {userId,pageSize, pageNum});



export const selectDay = (id, name, day) => http('/api/appointment/queryAppointmentDay', {id,name,day});



export const getdeparmentDay = (id) => http('/api/appointment/getAppointmentDay', {id});



export const deleteappointment = (id) => http('/api/appointment/deleteappointment', {id});

